public class demo6 {
    public String solve (String s, String t) {
        char[] ss = new StringBuilder(s).reverse().toString().toCharArray();
        char[] tt = new StringBuilder(s).reverse().toString().toCharArray();
        int m = ss.length, n = tt.length;
        int[] tmp = new int[m+n];
        for (int i = 0 ; i < m;i++ ){
            for (int j = 0; j < n; j++) {
                tmp[i+j] += (ss[i] -'0') * (tt[j] - '0');
            }
        }
         StringBuilder ret = new StringBuilder();
        int c = 0;
        for (int  x : tmp){
            c += x;
            ret.append((char)(c %10 +'0'));
            c /= 10;
        }
        while(c != 0){
            ret.append((char)(c %10 +'0'));
            c /= 10;
        }
        if (ret.length() >1 && ret.charAt(ret.length()-1) == '0'){
            ret.deleteCharAt(ret.length()-1);
        }
        return ret.reverse().toString();
    }
}
